package my.edu.model.commodity.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("product")
public class Product {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String productNo;
    private String imageUrl;
    private String productName;
    private Long categoryId;
    private Integer expiryNum;
    private String specificationModel;//规模型号
    private Long defaultSupplierId;//默认供应商id
    private String brand;//品牌
    private String unit;//单位
    private Integer currentStock;//当前库存
    private Integer initialQuantity;//期初数量
    private BigDecimal unitCost;//单位成本
    private BigDecimal initialTotalPrice;//期初总价
    private BigDecimal estimatedPurchasePrice;//预计采购价
    private BigDecimal highestPurchasePrice;//最高采购价
    private BigDecimal latestPurchasePrice;//最新采购价
    private BigDecimal lowestSalesPrice;//最低销售价
    private Integer minimumStock;//最低库存
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdTime;
    private String remark;
    private Integer status;
    private Integer isCommon;//是否常用
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @TableField(fill = FieldFill.UPDATE)
    private Long updatedBy;
    @TableField(fill = FieldFill.INSERT)
    private Long createdBy;
    @Version
    private Integer version;
}